import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
Vue.config.productionTip = false

Vue.filter('setTime', (time) => {
  const date = new Date(time)
  const y = date.getFullYear()
  const m = supplement(date.getMonth() + 1)
  const d = supplement(date.getDate())
  const hh = supplement(date.getHours())
  const mm = supplement(date.getMinutes())
  const ss = supplement(date.getSeconds())
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
function supplement(n) {
  return n > 9 ? n : '0' + n
}

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
